﻿#ifndef ASNYC_CLIENT_H
#define ASNYC_CLIENT_H

#include <QObject>
#include <QPixmap>
#include <QDebug>
#include <QMutex>
#include <QReadWriteLock>
#include <QSemaphore>
#include <QWaitCondition>
#include "opencv2/opencv.hpp"

// Sends a WebSocket message and prints the response
class AsyncProcess: public QObject
{
    Q_OBJECT
public:
    explicit AsyncProcess(QObject *parent = nullptr);

//signals:
//    void inDisplay(QPixmap pixmap);
//    void outDisplay(QPixmap pixmap);

    std::string host = "127.0.0.1";
    std::string port = "42002";
public slots:
    void startWebSocket();
    void connectWebSocketServer();
    void sendData(QString  filename);
    void getRecvData(cv::Mat& r_Img);
//    void sendData();
    void stopWebSocket();
};

#endif // ASNYC_CLIENT_H
